/**
 * @author      : 吴中勤
 * @date        : 2019-06-12
 * @description : TODO
 */

package org.mybatis.example;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.io.IOException;

public class Main4Test {

    public static void main(String[] args) throws IOException {
        SqlSessionFactory sqlSessionFactory = ResourcesInjector.getSqlSessionFactory();
        SqlSession session = sqlSessionFactory.openSession();
        try {
            BlogMapper mapper = session.getMapper(BlogMapper.class);
            Blog blog = mapper.selectBlog(101);
            System.out.println(blog);
        } finally {
            session.close();
        }
    }
}
